From 4222e8d71377adbb6b81f08d12e22d158dc17906 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 10 Oct 2014 15:52:48 -0400 Subject: [PATCH] inspector: Drop the button path The button path takes up quite a bit of room, and is not _that_ useful. If this information is useful, it can find a new home on the misc tab. --- gtk/inspector/Makefile.am | 3 - gtk/inspector/button-path.c | 86 --------------------------- gtk/inspector/button-path.h | 61 ------------------- gtk/inspector/button-path.ui | 55 ----------------- gtk/inspector/button-path.ui.h | 1 - gtk/inspector/init.c | 2 - gtk/inspector/inspector.gresource.xml | 1 - gtk/inspector/window.c | 3 - gtk/inspector/window.h | 1 - gtk/inspector/window.ui | 5 -- 10 files changed, 218 deletions(-) delete mode 100644 gtk/inspector/button-path.c delete mode 100644 gtk/inspector/button-path.h delete mode 100644 gtk/inspector/button-path.ui delete mode 100644 gtk/inspector/button-path.ui.h diff --git a/gtk/inspector/Makefile.am b/gtk/inspector/Makefile.am index dfd54e09f3..0069e6e6cc 100644 --- a/gtk/inspector/Makefile.am +++ b/gtk/inspector/Makefile.am @@ -19,8 +19,6 @@ libgtkinspector_la_SOURCES = \ action-editor.c \ actions.h \ actions.c \ - button-path.h \ - button-path.c \ classes-list.h \ classes-list.c \ css-editor.h \ @@ -95,7 +93,6 @@ libgtkinspector_la_LDFLAGS = \ templates = \ actions.ui \ - button-path.ui \ classes-list.ui \ css-editor.ui \ data-list.ui \ diff --git a/gtk/inspector/button-path.c b/gtk/inspector/button-path.c deleted file mode 100644 index cfd7041323..0000000000 --- a/gtk/inspector/button-path.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2013 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "config.h" -#include - -#include "button-path.h" - -#include "gtkbutton.h" -#include "gtkwidgetpath.h" - -struct _GtkInspectorButtonPathPrivate -{ - GtkWidget *sw; - GtkWidget *button_box; -}; - -G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorButtonPath, gtk_inspector_button_path, GTK_TYPE_BOX) - -static void -gtk_inspector_button_path_init (GtkInspectorButtonPath *bp) -{ - bp->priv = gtk_inspector_button_path_get_instance_private (bp); - gtk_widget_init_template (GTK_WIDGET (bp)); -} - -static void -gtk_inspector_button_path_class_init (GtkInspectorButtonPathClass *klass) -{ - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - - gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/button-path.ui"); - gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorButtonPath, sw); - gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorButtonPath, button_box); -} - -void -gtk_inspector_button_path_set_object (GtkInspectorButtonPath *bp, - GObject *object) -{ - GtkContainer *box = GTK_CONTAINER (bp->priv->button_box); - GtkWidget *b; - - gtk_container_foreach (box, (GtkCallback)gtk_widget_destroy, NULL); - - if (GTK_IS_WIDGET (object)) - { - GtkWidget *widget = GTK_WIDGET (object); - gchar *path, **words; - gint i; - - path = gtk_widget_path_to_string (gtk_widget_get_path (widget)); - words = g_strsplit (path, " ", 0); - - for (i = 0; i < g_strv_length (words); i++) - { - b = gtk_button_new_with_label (words[i]); - gtk_widget_show (b); - gtk_container_add (box, b); - } - - g_strfreev (words); - g_free (path); - } -} - -// vim: set et sw=2 ts=2: diff --git a/gtk/inspector/button-path.h b/gtk/inspector/button-path.h deleted file mode 100644 index c16efb6bc2..0000000000 --- a/gtk/inspector/button-path.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2013 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#ifndef _GTK_INSPECTOR_BUTTON_PATH_H_ -#define _GTK_INSPECTOR_BUTTON_PATH_H_ - - -#include - -#define GTK_TYPE_INSPECTOR_BUTTON_PATH (gtk_inspector_button_path_get_type()) -#define GTK_INSPECTOR_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPath)) -#define GTK_INSPECTOR_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPathClass)) -#define GTK_INSPECTOR_IS_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH)) -#define GTK_INSPECTOR_IS_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INSPECTOR_BUTTON_PATH)) -#define GTK_INSPECTOR_BUTTON_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPathClass)) - - -typedef struct _GtkInspectorButtonPathPrivate GtkInspectorButtonPathPrivate; - -typedef struct _GtkInspectorButtonPath -{ - GtkBox parent; - GtkInspectorButtonPathPrivate *priv; -} GtkInspectorButtonPath; - -typedef struct _GtkInspectorButtonPathClass -{ - GtkBoxClass parent; -} GtkInspectorButtonPathClass; - - -G_BEGIN_DECLS - -GType gtk_inspector_button_path_get_type (void); -void gtk_inspector_button_path_set_object (GtkInspectorButtonPath *bp, - GObject *object); - -G_END_DECLS - - -#endif // _GTK_INSPECTOR_BUTTON_PATH_H_ - -// vim: set et sw=2 ts=2: diff --git a/gtk/inspector/button-path.ui b/gtk/inspector/button-path.ui deleted file mode 100644 index 000287364d..0000000000 --- a/gtk/inspector/button-path.ui +++ /dev/null @@ -1,55 +0,0 @@ - - - - - vertical - False - - - - - - diff --git a/gtk/inspector/button-path.ui.h b/gtk/inspector/button-path.ui.h deleted file mode 100644 index b3eeb3d78b..0000000000 --- a/gtk/inspector/button-path.ui.h +++ /dev/null @@ -1 +0,0 @@ -N_("Choose a widget through the inspector"); diff --git a/gtk/inspector/init.c b/gtk/inspector/init.c index 68d3149c22..8d3ef359f2 100644 --- a/gtk/inspector/init.c +++ b/gtk/inspector/init.c @@ -25,7 +25,6 @@ #include "init.h" #include "actions.h" -#include "button-path.h" #include "classes-list.h" #include "css-editor.h" #include "data-list.h" @@ -56,7 +55,6 @@ gtk_inspector_init (void) gtk_inspector_register_resource (); g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS); - g_type_ensure (GTK_TYPE_INSPECTOR_BUTTON_PATH); g_type_ensure (GTK_TYPE_INSPECTOR_CLASSES_LIST); g_type_ensure (GTK_TYPE_INSPECTOR_CSS_EDITOR); g_type_ensure (GTK_TYPE_INSPECTOR_DATA_LIST); diff --git a/gtk/inspector/inspector.gresource.xml b/gtk/inspector/inspector.gresource.xml index ef57d5eb19..76385e6512 100644 --- a/gtk/inspector/inspector.gresource.xml +++ b/gtk/inspector/inspector.gresource.xml @@ -2,7 +2,6 @@ actions.ui - button-path.ui classes-list.ui css-editor.ui data-list.ui diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index 3e3750dbce..8a8a27ca12 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -35,7 +35,6 @@ #include "widget-tree.h" #include "python-hooks.h" #include "python-shell.h" -#include "button-path.h" #include "size-groups.h" #include "style-prop-list.h" #include "data-list.h" @@ -79,7 +78,6 @@ on_widget_tree_selection_changed (GtkInspectorWidgetTree *wt, gtk_inspector_signals_list_set_object (GTK_INSPECTOR_SIGNALS_LIST (iw->signals_list), selected); gtk_inspector_object_hierarchy_set_object (GTK_INSPECTOR_OBJECT_HIERARCHY (iw->object_hierarchy), selected); gtk_inspector_misc_info_set_object (GTK_INSPECTOR_MISC_INFO (iw->misc_info), selected); - gtk_inspector_button_path_set_object (GTK_INSPECTOR_BUTTON_PATH (iw->button_path), selected); gtk_inspector_classes_list_set_object (GTK_INSPECTOR_CLASSES_LIST (iw->classes_list), selected); gtk_inspector_css_editor_set_object (GTK_INSPECTOR_CSS_EDITOR (iw->widget_css_editor), selected); gtk_inspector_size_groups_set_object (GTK_INSPECTOR_SIZE_GROUPS (iw->size_groups), selected); @@ -177,7 +175,6 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass) gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, signals_list); - gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, button_path); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, classes_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, style_prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_css_editor); diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h index a9096b2ac1..c9fec99e3c 100644 --- a/gtk/inspector/window.h +++ b/gtk/inspector/window.h @@ -48,7 +48,6 @@ typedef struct GtkWidget *signals_list; GtkWidget *style_prop_list; GtkWidget *python_shell; - GtkWidget *button_path; GtkWidget *classes_list; GtkWidget *widget_css_editor; GtkWidget *object_hierarchy; diff --git a/gtk/inspector/window.ui b/gtk/inspector/window.ui index a2315110fe..35cb17bd6f 100644 --- a/gtk/inspector/window.ui +++ b/gtk/inspector/window.ui @@ -52,11 +52,6 @@ True vertical - - - True - - True -- 2.30.2